#include "stdafx.h"
#include "VertexDefinition.h"

using namespace MomogenkyouSystem;

const	size_t			Vertex::FVF(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1);
		VERTEXDECLARE	Vertex::m_VertexDelaration(NULL);
const	VERTEXELEMENT	Vertex::m_VertexElements[]	=	
{
	{0, 0,	D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION,	0},
	{0, 16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD,	0},
	{0, 24,	D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR,		0},
	D3DDECL_END()
};


void Vertex::InitializeVertexDeclaration()
{
	HRESULT Result = GraphicsSystem::Device->CreateVertexDeclaration(m_VertexElements, &m_VertexDelaration);
	ASSERT(Result == S_OK, "ErrorCreating Vertex Declaration");
}